namespace SampleApp.Controllers {
    using System.Linq;
    using System.Web.Mvc;

    using SampleApp.Models;

    public class ShopController : Controller {

        private SampleAppContext context = new SampleAppContext();

        public ViewResult Index() {
            return View(
                from c in context.Categories
                select new {
                    name = c.Name,
                    products = from p in c.Products select new {
                        id = p.Id, name = p.Name, price = p.UnitPrice
                    }
                });
        }
    }
}